server.host: "0.0.0.0"
server.name: "{{ inventory_hostname }}"
server.securityResponseHeaders.strictTransportSecurity: "max-age=31536000"
server.securityResponseHeaders.disableEmbedding: true

path.data: "{{ elk_data_root_path }}/{{ elk_role }}"

elasticsearch.hosts:
{% for ip in es_master_ips %}
    - {{ elk_schema }}{{ ip }}:9200
{% endfor %}

{% if elk_tls_enabled %}
server.ssl.enabled: true
server.ssl.certificate: /etc/kibana/tls/{{ es_cluster_name }}-certificate.pem
server.ssl.key: /etc/kibana/tls/{{ es_cluster_name }}-certificate.key

elasticsearch.username: "kibana_system"

elasticsearch.ssl.keystore.path: /etc/kibana/tls/elastic-certificates.p12
elasticsearch.ssl.verificationMode: none
{% endif %}

xpack.security.cookieName: "{{ es_cluster_name }}"
xpack.security.secureCookies: true

csp.strict: true

# For 8.x upgrade
xpack.reporting.roles.enabled: false

xpack.security.session.idleTimeout: "1h"
xpack.security.session.lifespan: "30d"

newsfeed.enabled: false

logging:
  appenders:
    rolling-file:
      type: rolling-file
      fileName: "{{ elk_logs_root_path }}/kibana/kibana.stdout"
      policy:
        type: size-limit
        size: 50mb
      layout:
        type: pattern

# Monitoring
monitoring.kibana.collection.enabled: false
xpack.monitoring.collection.enabled: {{ (elk_version is version('8', '<')) | ternary(true, false) | lower }}

{% if flt_enabled %}
# Fleet
{{ lookup('template', 'kibana/xpack_fleet.yml.j2') | from_yaml | to_nice_yaml }}
{% endif %}
